<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:outputStylesheet name="styles.css" library="css" />

<h:head>
	<title>#{user.openCategory}</title>
</h:head>

<h:body class="body" align="center"><div class="main">
	<h:form><h:commandLink value="Home" action="#{user.reset}" /> \</h:form>
	<h:form>
	<h:dataTable value="#{service.threads(user.openCategory)}" var="thread" rowClasses="post">
		<h:column>
			<h:commandLink value="#{thread.title} ##{thread.id}" action="#{service.showThread(thread)}" />
		</h:column>
		<h:column rendered="#{user.canDelete()}">
			<h:commandButton class="delButton" value="X" action="#{service.deleteThread(thread)}"/>
		</h:column>
	</h:dataTable>
	</h:form>
	<h:form rendered="#{user.canPost()}">
	<table>
		<tr><td><h:inputText value="#{user.title}" class="inputField" /></td></tr>
		<tr><td rowspan="3"><h:inputTextarea value="#{user.content}" /></td></tr>
		<tr><td><h:commandButton value="submit thread" action="#{user.submit}" class="sendButton" /></td></tr>	
	</table>
	</h:form>
	
</div></h:body>
</html>